Repository navigation
Add the repository map (repo_map tool, pinned core/repo-map, lsp map) - #149
Merged
Merged
Conversation
leonardoaraujosantos
force-pushed
the
feat/repository-map
branch
2 times, most recently
from
November 19, 2026 05:34
abf4e66 to
da8a6b5
Compare
Reference captures replace the identifier fallback where a query has them, so local variables no longer link files; ranking damps ubiquitous names and boosts distinctive ones, focus symbols personalize their definers and referrers, and focus files render first. Ignored files are not walked, so they carry no exclusion reason; pruned default directories count once. Container rows end at the body, like every signature.
…nd inspection cyber-tools gains a repo_map module: tree-sitter tag queries for eleven bundled languages, an ignore-aware walk with default excludes and .gitattributes linguist attributes, a content-addressed SQLite cache at <cache>/repo-map/index.db shared across worktrees, bounded builds with a cross-process lock, personalized PageRank over the reference graph and a binary-searched renderer that fits a token budget. The read-only repo_map tool is offered when repo_map.enabled holds, also in plan mode, and hides files whose read rule denies them. Context Sources can now be epoch-pinned: observed only when a baseline renders, skipped by reconciliation and omitted after a 2 s bound. core/repo-map is the first such source, in trusted checkouts only. Model profiles gain repo_map budgets with window caps; the top-level repo_map key configures the map. The server adds GET /lsp/map and POST /lsp/map/rebuild, the CLI cyber lsp map, and telemetry a counts-only repo_map.build span.
/map [<path>] loads GET /lsp/map at the Session model's tool budget and opens a view with the index status header; r rebuilds, Enter opens the selected path in the file explorer and Esc closes. A disabled map shows a message and opens nothing.
On pull requests, build the stripped release binary for the base and the head and fail when the head is more than 12 MiB larger.
… lsp map Also run the TUI map screens on the default test runtime.
Workspace crates are fingerprinted by mtime, so the head build reused the base build's artifacts.
The commands catalog must name every TUI slash command. Agent configuration under .cyber/ is not code, and listing it leaked skill paths into the baseline map. TUI screens drive a keyword-matching scripted model, so their fixture keeps the map out of the baseline.
leonardoaraujosantos
force-pushed
the
feat/repository-map
branch
from
November 19, 2026 09:28
da8a6b5 to
d94ddea
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the OpenSpec change
add-repository-map: a ranked, token-budgeted map of the repository's files and definitions for the agent.What changes
cyber-tools/src/repo_map/): tree-sitter tag queries for Rust, Python, JS/JSX, TypeScript, TSX, Go, C, C++, Java, Solidity and Bash (pinned grammar crates); thegrep/globignore-aware walk with default excludes,.gitattributeslinguist attributes andinclude/excludeglobs; a content-addressed SQLite cache at<cache>/repo-map/index.db(0600, WAL) shared across worktrees; bounded builds (max files, build timeout, 250 ms parse timeout) with a cross-process lock, partial resume and GC.repo_maptool: read-only, offered in plan mode and untrusted checkouts, hides read-denied files, refreshes first and waits at most 10 s for a build. Edit tools mark files dirty.system-context): observed only when a baseline renders, never reconciled, omitted after a 2 s bound;core/repo-mapis the first, in trusted checkouts only;/contextmarks itpinned.repo_map: { context_tokens, tool_tokens }with window caps; top-levelrepo_mapconfig key.GET /api/v1/lsp/map,POST /api/v1/lsp/map/rebuild,cyber lsp map(server or in-process), TUI/map.repo_map.buildspan; the index is never in backups/exports.Spec deviations (spec updated in the first commit)
Measured on this repository, the spec'd ranking filled the map with
map/clone/formatand local variable names. So: queries capture call/type/import references (identifier fallback only for Bash),m(x)adds a ×10 boost for distinctive names and ×0.1 for ubiquitous ones, focus symbols personalize their definers/referrers, and focus files render first. Ignored files are not walked (noignoredreason); pruned default directories count once;.cyber/(agent configuration) is a default exclude; container rows end at the body (impl Server).Not done here
improve-model-protocol-fidelityis not archivable yet (its live tests need keys).Local gate: fmt, clippy
-D warningson all touched crates, scoped nextest runs,openspec validate --all --strict,spec_lint(0 errors, same warnings as main),spec_inventory --check.sdk/openapi.json, the TS SDK anddocs/cli.mdwere regenerated on a CI runner because local disk was exhausted at the time.